package com.farmpost.ssoservice.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.farmpost.ssoservice.dao.RoleMapper;
import com.farmpost.ssoservice.pojo.Role;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 角色表 服务实现类
 * </p>
 *
 * @author king
 * @since 2022-04-03
 */
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> {

    @Autowired
    private RoleMapper roleMapper;

    /**
     * 根据UserId获取角色列表
     *
     * @param userId
     * @return
     */
    public List<Role> getRolesByUserId(Integer userId) {
        return roleMapper.getRolesByUserId(userId);
    }
}
